from django import forms
from .models import Poet

class PoetForm(forms.Form):
    name = forms.CharField(max_length=20)
    sex = forms.ChoiceField(choices=((1,'男'),(2,'女'),(3,'KONG')))
    dynasty = forms.ChoiceField(choices=((1,'唐'),(2,'宋'),(3,'元')))

class PoetModelForm(forms.ModelForm):
    class Meta:
        model = Poet 
        fields = ['sex','name','dynasty']

